<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2024-01-27 Sat 11:58 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Example</title>
<meta name="author" content="Joshua Branson" />
<meta name="generator" content="Org Mode" />
<link rel="stylesheet" href="../css/normalize.css" type="text/css"/><link rel="stylesheet" href="../css/default-org-stylesheet.css" type="text/css"/><link rel="stylesheet" href="../css/stylesheet.css" type="text/css"/>
</head>
<body>
<div id="preamble" class="status">
<nav><a href="../index.html">Home</a><a href="../about.html">About</a><a href="../blog/index.html">Blog</a></nav>
</div>
<div id="content" class="content">
<h1 class="title">Example</h1>

<div id="outline-container-orgf9f62ea" class="outline-2">
<h2 id="orgf9f62ea"><span class="todo TODO">TODO</span> fix Path math everywhere</h2>
<div class="outline-text-2" id="text-orgf9f62ea">
<div class="org-src-container">
<pre class="src src-C"><span style="font-weight: bold;">#include</span> <span style="font-style: italic;">&lt;stdio.h&gt;</span>

<span style="font-weight: bold;">#define</span> <span style="font-weight: bold; font-style: italic;">PATH_MAX</span> <span style="font-style: italic;">"evil"</span>

<span style="font-weight: bold; text-decoration: underline;">int</span> <span style="font-weight: bold;">main</span> () {
  <span style="font-weight: bold;">return</span> 0;
}
</pre>
</div>
</div>

<div id="outline-container-org7061b96" class="outline-3">
<h3 id="org7061b96"><span class="done DONE">DONE</span> convince the Guix people to use scheme everywhere&#xa0;&#xa0;&#xa0;<span class="tag"><span class="scheme">scheme</span></span></h3>
<div class="outline-text-3" id="text-org7061b96">
<div class="org-src-container">
<pre class="src src-scheme">(<span style="font-weight: bold;">define</span> (<span style="font-weight: bold;">main</span> args)
  <span style="font-weight: bold; font-style: italic;">;;</span><span style="font-weight: bold; font-style: italic;">the option specification tells getopt-long how</span>
  <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">to parse the command line</span>
  (<span style="font-weight: bold;">let*</span> ((option-spec '((version (single-char #\v) (value #f))
                        (help    (single-char #\h) (value #f))
                        (calc    (single-char #\c) (value #t)
                                 <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">(required #t)</span>
                                 )))
         <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">tell getopt-long to parse the command line and put the</span>
         <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">data in options</span>
         (options (getopt-long args option-spec))
         <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">was  --help or -h used?</span>
         (help-wanted (option-ref options 'help #f))
         (version-wanted (option-ref options 'version #f))
         <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">was -c or --calc used?  If there was no value given,</span>
         <span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">then return #f</span>
         (calc-wanted (option-ref options '() #f)))
    (<span style="font-weight: bold;">if</span> (<span style="font-weight: bold;">or</span> version-wanted help-wanted)
        (<span style="font-weight: bold;">cond</span>
         (help-wanted
          (display <span style="font-style: italic;">"calc [options]\n"</span>)
          (display <span style="font-style: italic;">"-v  --version  Display version\n"</span>)
          (display <span style="font-style: italic;">"-h, --help     Display this help info\n"</span>))
         (version-wanted
          (display <span style="font-style: italic;">"calc version 0.1\n"</span>)))
        (display calc-wanted))))

</pre>
</div>
</div>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="date">Date: 2024-01-25 Thu 16:00</p>
<p class="author">Author: Joshua Branson</p>
<p class="date">Created: 2024-01-27 Sat 11:58</p>
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>
</html>